package indzcraft.calc;

public class Glyphs implements Cloneable {
	
	int sinister_strike = 0;
	int adrenaline_rush = 0;
	int slice_and_dice = 0;
	int eviscerate = 0;
	int revealing_strike = 0;
	int killing_spree = 0;
	int tricks_of_the_trade = 0;
	int hemorrhage = 0;
	int backstab = 0;
	int shadow_dance = 0;
	
	public Glyphs(String[] strings)
	{
		for (String item: strings) {
			proceed_glyph(item);
		}
	}
	
	public void proceed_glyph(String glyph) {
		try {
			if (glyph.equals("sinister_strike")) {
				sinister_strike = 1;
			}
			else if (glyph.equals("adrenaline_rush")) {
				adrenaline_rush = 1;
			}
			else if (glyph.equals("killing_spree")) {
				killing_spree = 1;
			}
			else if (glyph.equals("slice_and_dice")) {
				slice_and_dice = 1;
			}
			else if (glyph.equals("eviscerate")) {
				eviscerate = 1;
			}
			else if (glyph.equals("backstab")) {
				backstab = 1;
			}
			else if (glyph.equals("hemorrhage")) {
				hemorrhage = 1;
			}
			else if (glyph.equals("tricks_of_the_trade")) {
				tricks_of_the_trade = 1;
			}
			else if (glyph.equals("shadow_dance")) {
				shadow_dance = 1;
			}
			else {
				throw new GlyphNotExistsException("Glyph not found",glyph);
			}
		}
		catch(GlyphNotExistsException e) {
			System.out.println(e.getMessage());
		}
	}
	
	public void ep_glyph(String glyph) {
		try {
			if (glyph.equals("sinister_strike")) {
				sinister_strike = 1-sinister_strike;
			}
			else if (glyph.equals("adrenaline_rush")) {
				adrenaline_rush = 1-adrenaline_rush;
			}
			else if (glyph.equals("killing_spree")) {
				killing_spree = 1-killing_spree;
			}
			else if (glyph.equals("slice_and_dice")) {
				slice_and_dice = 1-slice_and_dice;
			}
			else if (glyph.equals("eviscerate")) {
				eviscerate = 1-eviscerate;
			}
			else if (glyph.equals("backstab")) {
				backstab = 1-backstab;
			}
			else if (glyph.equals("hemorrhage")) {
				hemorrhage = 1-hemorrhage;
			}
			else if (glyph.equals("tricks_of_the_trade")) {
				tricks_of_the_trade = 1-tricks_of_the_trade;
			}
			else if (glyph.equals("shadow_dance")) {
				shadow_dance = 1-shadow_dance;
			}
			else {
				throw new GlyphNotExistsException("Glyph not found",glyph);
			}
		}
		catch(GlyphNotExistsException e) {
			System.out.println(e.getMessage());
		}
	}
	
	public Glyphs clone()
	{
		Object theClone = null;
		try {
			theClone = super.clone();
		}
		catch(CloneNotSupportedException e) {}
		
		return (Glyphs)theClone;
	}
}
